/*=============================================================================
*
*   Copyright (C) 2020 All rights reserved.
*
*   Filename:		component.hpp
*
*   Author: Wang Zhecheng - wangzhecheng@yeah.net
*
*   Date:  2020-01-17 16:52
*
*   Last Editors: Wang Zhecheng - wangzhecheng@yeah.net
*
*   Last modified:	2020-03-25 10:02
*
*   Description:
*
=============================================================================*/
#if !defined(BASIC_MESH_COMPONENT_CLASS_H)
#define BASIC_MESH_COMPONENT_CLASS_H

#include <memory>
#include <string>

namespace geoxfem::util {

template <typename T>
struct Component {
  /**
   * @brief constructor with parent class pointer
   *
   * @param _pMesh
   */
  Component(T* const pParent) : m_parent{pParent} {}
  Component()                     = default;
  Component(const Component& rhs) = default;
  Component(Component&& rhs)      = default;
  ~Component()                    = default;
  Component& operator=(const Component& rhs) = default;
  Component& operator=(Component&& rhs) = default;
  ////////////////////////////////////////////////////////////////
  ////////////////////////////////////////////////////////////////
  ////////////////////////////////////////////////////////////////

  /**
   * @brief get Pointer to parent class object
   *
   * @return
   */
  T* getParent() const {
    return m_parent;
  }
  /**
   * @brief set pointer of parent class object
   *
   * @param _pParent
   */
  virtual void setParent(T* const _pParent) {
    m_parent = _pParent;
  }

private:
  /// pointer to parent class
  T* m_parent;
};

}  // namespace geoxfem::util
#endif  /// _BASIC_MESH_COMPONENT_CLASS_H
